package com.nju.edu.erp.service.hr;

import com.nju.edu.erp.dao.StuffDao;
import com.nju.edu.erp.model.po.StuffPO;

import java.math.BigDecimal;

public class YearPay implements GetSalaryWithTax {

    private final StuffDao stuffDao;

    YearPay(StuffDao stuffDao){
        this.stuffDao=stuffDao;
    }

    @Override
    public BigDecimal getSalaryWithTax(String name) {
        //处于演示考虑，假定该月发放年薪
        StuffPO stuffPO=stuffDao.getStuffByName(name);
        BigDecimal salaryWithTax=stuffPO.getBaseSalary().add(stuffPO.getJobSalary());
        return salaryWithTax;
    }
}
